import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)


Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default new Router({
    routes: [
        {
            path: '/',
            name: 'home',
            component: resolve => require(['@/components/home'], resolve),
            meta: {
                title: '首页',
            },
        children: [
            {
            path: '/',
            name: 'index',
            component: resolve => require(['@/components/index'], resolve),
            meta: {
                title: '首页',
            },
        },  
        //项目申报
        {
            path: '/declare',
            name: 'declare',
            component: resolve => require(['@/components/declare'], resolve),
            meta: {
                title: '项目申报',
            },
        },
        //研究生电子设计大赛
        {
            path: '/match',
            name: 'match',
            component: resolve => require(['@/components/match/match'], resolve),
            meta: {
                title: '研究生电子设计大赛',
            },
        },
        //创新创业
        {
            path: '/innovate',
            name: 'innovate',
            component: resolve => require(['@/components/innovate/innovate'], resolve),
            meta: {
                title: '创新创业',
            },
        },
        //研科协
        {
            path: '/afrat',
            name: 'afrat',
            component: resolve => require(['@/components/afrat/afrat'], resolve),
            meta: {
                title: '研科协',
            },
        },
        //讲座论坛
        {
            path: '/forum',
            name: 'forum',
            component: resolve => require(['@/components/forum/forum'], resolve),
            meta: {
                title: '讲座论坛',
            },
        },
        //学科竞赛
        {
            path: '/competition',
            name: 'competition',
            component: resolve => require(['@/components/competition/competition'], resolve),
            meta: {
                title: '学科竞赛',
            },
        },
            //详情
            {
                path: '/Detailid',
                name: 'Detailid',
                component: resolve => require(['@/components/details/Detailid'], resolve),
                meta: {
                    title: '详情',
                },
            },
            //大赛详情
            {
                path: '/dsdetails',
                name: 'dsdetails',
                component: resolve => require(['@/components/details/dsdetails'], resolve),
                meta: {
                    title: '大赛详情',
                },
            },
    ]
        }
        
    ]
})